package com.cx.service.impl;

import com.cx.mapper.ProvinceMapper;
import com.cx.pojo.Province;
import com.cx.service.ProvinceService;
import com.cx.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class ProvinceServiceImpl implements ProvinceService {
    @Override
    public List<Province> selectAll() {
        SqlSession sqlSession = SqlSessionUtil.openSqlSession();
        ProvinceMapper provinceMapper = sqlSession.getMapper(ProvinceMapper.class);
        List<Province> provinces = provinceMapper.selectAll();
        sqlSession.close();
        return provinces;
    }
}
